package org.breathe.thread.pool.common.enums;

import lombok.Getter;

/**
 * 配置文件类型
 * @author: breathe
 * @createTime: 2025-04-13
 */
@Getter
public enum ConfigFileTypeEnum {

    PROPERTIES("properties"),
    XML("xml"),
    JSON("json"),
    YML("yml"),
    YAML("yaml"),
    TXT("txt")
    ;

    private final String value;
    ConfigFileTypeEnum(String value) {
        this.value = value;
    }

    public static ConfigFileTypeEnum of(String value) {
        for (ConfigFileTypeEnum typeEnum: ConfigFileTypeEnum.values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        return PROPERTIES;
    }
}
